package main
import (
	"fmt"
	"os"
)

func main(){
	dirName := "temp_dir"
	if err := os.Mkdir(dirName,0755);err!=nil {
		fmt.Println("os Mkdir err:",err)
		return
	}
	
	nestedDir := "nest/dir/here"
	if err := os.MkdirAll(nestedDir,0777);err!=nil {
		fmt.Println("os MkdirAll err:",err)
		return
	}

	// it will clean nested dir first
	if err := os.RemoveAll(nestedDir);err!=nil {
		fmt.Println("os RemoveAll err:",err)
		return
	}

		
	if err := os.Remove(dirName);err!=nil {
		fmt.Println("os Remove err:",err)
		return
	}

}